Home:ALL Converter>Why can't hadoop find class of RackAareness?

Why can't hadoop find class of RackAareness?

Ask Time:2019-10-08T10:50:22         Author:asdfjk

Json Formatter

I have configured net.topology.node.switch.mapping.impl property in core-site.xml.The value of class is com.learning.rackawareness.RackAwareness. I already packaged the class to be jar and put it up Linux in hadoop path of /opt/modules/hadoop-2.7.2/share/hadoop/common/lib.

Then I used start-dfs.sh, Namenode failed.

where should I do to put the jar?

java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class com.learning.rackawareness.RackAwareness not found at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2227) at org.apache.hadoop.hdfs.server.blockmanagement.DatanodeManager.(DatanodeManager.java:208) at org.apache.hadoop.hdfs.server.blockmanagement.BlockManager.(BlockManager.java:268) at org.apache.hadoop.hdfs.server.namenode.FSNamesystem.(FSNamesystem.java:737) at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.initialize(SecondaryNameNode.java:246) at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.(SecondaryNameNode.java:192) at org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode.main(SecondaryNameNode.java:671) Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: Class >com.learning.rackawareness.RackAwareness not found at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2195) at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2219) ... 6 more Caused by: java.lang.ClassNotFoundException: Class >com.learning.rackawareness.RackAwareness not found at org.apache.hadoop.conf.Configuration.getClassByName(Configuration.java:2101) at org.apache.hadoop.conf.Configuration.getClass(Configuration.java:2193) ... 7 more 2019-10-07 15:23:41,958 INFO org.apache.hadoop.hdfs.server.namenode.FSNamesystem: Stopping services started for active state 2019-10-07 15:23:41,970 INFO org.apache.hadoop.hdfs.server.namenode.SecondaryNameNode: SHUTDOWN_MSG:

Author:asdfjk,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/58279611/why-cant-hadoop-find-class-of-rackaareness
yy